<?

	Db_DbHelper::query('CREATE TABLE `shop_country_lookup` (
	  `id` int(11) NOT NULL auto_increment,
	  `iso_code` varchar(10) default NULL,
	  `usps_name` varchar(150) default NULL,
	  PRIMARY KEY  (`id`),
	  KEY `iso_code` (`iso_code`)
	) ENGINE=MyISAM DEFAULT CHARSET=utf8');
	
	$usps_countries = array(
		'AE'=>'United Arab Emirates',
		'PG'=>'Papua New Guinea',
		'AF'=>'Afghanistan',
		'NZ'=>'New Zealand',
		'FI'=>'Finland',
		'AL'=>'Albania',
		'GB'=>'United Kingdom (Great Britain)',
		'DZ'=>'Algeria',
		'ES'=>'Spain',
		'NC'=>'New Caledonia',
		'IN'=>'India',
		'AD'=>'Andorra',
		'AO'=>'Angola',
		'AI'=>'Anguilla',
		'KM'=>'Comoros',
		'GQ'=>'Equatorial Guinea',
		'AG'=>'Antigua and Barbuda',
		'AR'=>'Argentina',
		'AM'=>'Armenia',
		'AW'=>'Aruba',
		'GR'=>'Greece',
		'WS'=>'Western Samoa',
		'AU'=>'Australia',
		'AT'=>'Austria',
		'AZ'=>'Azerbaijan',
		'PT'=>'Portugal',
		'BS'=>'Bahamas',
		'BH'=>'Bahrain',
		'PK'=>'Pakistan',
		'BD'=>'Bangladesh',
		'VU'=>'Vanuatu',
		'BB'=>'Barbados',
		'GP'=>'Guadeloupe',
		'BY'=>'Belarus',
		'BE'=>'Belgium',
		'BZ'=>'Belize',
		'BJ'=>'Benin',
		'BM'=>'Bermuda',
		'BT'=>'Bhutan',
		'BO'=>'Bolivia',
		'AN'=>'Netherlands Antilles',
		'PF'=>'French Polynesia',
		'ID'=>'Indonesia',
		'MY'=>'Malaysia',
		'BA'=>'Bosnia-Herzegovina',
		'BW'=>'Botswana',
		'RE'=>'Reunion',
		'BR'=>'Brazil',
		'GY'=>'Guyana',
		'VG'=>'British Virgin Islands',
		'BN'=>'Brunei Darussalam',
		'BG'=>'Bulgaria',
		'BF'=>'Burkina Faso',
		'MM'=>'Myanmar (Burma)',
		'BI'=>'Burundi',
		'TC'=>'Turks and Caicos Islands',
		'KH'=>'Kampuchea (Cambodia)',
		'CM'=>'Cameroon',
		'CA'=>'Canada',
		'KI'=>'Kiribati',
		'CV'=>'Cape Verde',
		'KY'=>'Cayman Islands',
		'CF'=>'Central African Rep.',
		'LK'=>'Sri Lanka',
		'TD'=>'Chad',
		'CL'=>'Chile',
		'CN'=>'China',
		'CO'=>'Colombia',
		'CD'=>'Congo, Democratic Republic of the',
		'CG'=>'Congo, Republic of the (Brazzaville)',
		'CK'=>'Cook Islands (New Zealand)',
		'FR'=>'France',
		'CR'=>'Costa Rica',
		'CI'=>'Côte d\'Ivoire',
		'HR'=>'Croatia',
		'CU'=>'Cuba',
		'MT'=>'Malta',
		'LY'=>'Tripolitania (Libya)',
		'CY'=>'Cyprus',
		'CZ'=>'Czech Republic',
		'DK'=>'Denmark',
		'DJ'=>'Djibouti',
		'QA'=>'Qatar',
		'DM'=>'Dominica',
		'DO'=>'Dominican Republic',
		'TL'=>'East Timor (Indonesia)',
		'EC'=>'Ecuador',
		'EG'=>'Egypt',
		'IE'=>'Ireland',
		'SV'=>'Salvador (El Salvador)',
		'TV'=>'Tuvalu',
		'ER'=>'Eritrea',
		'EE'=>'Estonia',
		'ET'=>'Ethiopia',
		'FK'=>'Falkland Islands',
		'FO'=>'Faroe Islands',
		'FJ'=>'Fiji',
		'TW'=>'Taiwan',
		'GF'=>'French Guiana',
		'TO'=>'Tonga',
		'WF'=>'Wallis and Futuna Islands',
		'GA'=>'Gabon',
		'GM'=>'Gambia',
		'GE'=>'Georgia, Republic of',
		'DE'=>'Germany',
		'GH'=>'Ghana',
		'GI'=>'Gibraltar',
		'GL'=>'Greenland',
		'GD'=>'Grenada',
		'VC'=>'Saint Vincent and the Grenadines',
		'GT'=>'Guatemala',
		'GN'=>'Guinea',
		'GW'=>'Guinea-Bissau',
		'HT'=>'Haiti',
		'JO'=>'Trans-Jordan (Hashemite Kingdom) (Jordan)',
		'NL'=>'Netherlands',
		'HN'=>'Honduras',
		'HK'=>'Hong Kong',
		'HU'=>'Hungary',
		'IS'=>'Iceland',
		'IR'=>'Persia (Iran)',
		'IQ'=>'Iraq',
		'IL'=>'Israel',
		'IT'=>'Italy',
		'JM'=>'Jamaica',
		'JP'=>'Japan',
		'KZ'=>'Kazakhstan',
		'KE'=>'Kenya',
		'KR'=>'South Korea (Korea, Republic of)',
		'KW'=>'Kuwait',
		'KG'=>'Kyrgyzstan',
		'LA'=>'Laos',
		'LV'=>'Latvia',
		'LB'=>'Lebanon',
		'LS'=>'Lesotho',
		'LR'=>'Liberia',
		'LI'=>'Liechtenstein',
		'LT'=>'Lithuania',
		'LU'=>'Luxembourg',
		'MO'=>'Macau (Macao)',
		'MK'=>'Macedonia',
		'MG'=>'Madagascar',
		'MW'=>'Malawi',
		'MV'=>'Maldives',
		'ML'=>'Mali',
		'MQ'=>'Martinique',
		'MR'=>'Mauritania',
		'MU'=>'Mauritius',
		'YT'=>'Mayotte (France)',
		'MX'=>'Mexico',
		'PM'=>'Saint Pierre and Miquelon',
		'MD'=>'Moldova',
		'MC'=>'Monaco (France)',
		'MN'=>'Mongolia',
		'MS'=>'Montserrat',
		'MA'=>'Morocco',
		'MZ'=>'Mozambique',
		'OM'=>'Oman',
		'NA'=>'Namibia',
		'NR'=>'Nauru',
		'NP'=>'Nepal',
		'KN'=>'Saint Kitts (St. Christopher and Nevis)',
		'NI'=>'Nicaragua',
		'NE'=>'Niger',
		'NG'=>'Nigeria',
		'NU'=>'Niue (New Zealand)',
		'NF'=>'Australia',
		'NO'=>'Norway',
		'PA'=>'Panama',
		'PY'=>'Paraguay',
		'TZ'=>'Zanzibar (Tanzania)',
		'PE'=>'Peru',
		'PH'=>'Philippines',
		'PN'=>'Pitcairn Island',
		'PL'=>'Poland',
		'ZW'=>'Zimbabwe',
		'RO'=>'Romania',
		'RU'=>'Russia',
		'RW'=>'Rwanda',
		'SH'=>'Saint Helena',
		'LC'=>'Saint Lucia',
		'SM'=>'San Marino',
		'SB'=>'Solomon Islands',
		'ST'=>'Sao Tome and Principe',
		'SA'=>'Saudi Arabia',
		'SN'=>'Senegal',
		'RS'=>'Serbia-Montenegro',
		'SC'=>'Seychelles',
		'TH'=>'Thailand',
		'SL'=>'Sierra Leone',
		'SG'=>'Singapore',
		'SK'=>'Slovak Republic',
		'SI'=>'Slovenia',
		'SO'=>'Somaliland (Somalia)',
		'ZA'=>'South Africa',
		'GS'=>'South Georgia (Falkland Islands)',
		'SD'=>'Sudan',
		'SR'=>'Suriname',
		'SZ'=>'Swaziland',
		'SE'=>'Sweden',
		'CH'=>'Switzerland',
		'SY'=>'Syrian Arab Republic',
		'TJ'=>'Tajikistan',
		'TT'=>'Trinidad and Tobago',
		'TG'=>'Togo',
		'TK'=>'Tokelau (Union) Group (Western Samoa)',
		'TN'=>'Tunisia',
		'TR'=>'Turkey',
		'TM'=>'Turkmenistan',
		'UG'=>'Uganda',
		'UA'=>'Ukraine',
		'UY'=>'Uruguay',
		'UZ'=>'Uzbekistan',
		'VA'=>'Vatican City',
		'VE'=>'Venezuela',
		'VN'=>'Vietnam',
		'YE'=>'Yemen',
		'ZM'=>'Zambia'
	);
	
	foreach ($usps_countries as $iso_code=>$name)
	{
		Db_DbHelper::query('insert into shop_country_lookup(iso_code, usps_name) values (:code, :name)', array(
			'code'=>$iso_code,
			'name'=>$name
		));
	}

?>